#include "StdAfx.h"
#include "ZSocketListenerFactory.h"
#include "ZUdp\ZUdpSocketListener.h"
#include "ZTcp\ZTcpSocketListener.h"


ZSocketListenerFactory::ZSocketListenerFactory(void)
{
}


ZSocketListenerFactory::~ZSocketListenerFactory(void)
{
}

ZSocketListener* ZSocketListenerFactory::CreateListener( qint16 iPort, ZSocketType listenType, ZSocketRecvReactor* pRecvReactor )
{
	if (ZSocket_UDP == listenType)
	{
		ZUdpSocketListener* pUdpSocketListener = new ZUdpSocketListener(iPort, pRecvReactor);
		return pUdpSocketListener;
	}
	else
	{
		ZTcpSocketListener* pTcpSocketListener = new ZTcpSocketListener(iPort, pRecvReactor);
		return pTcpSocketListener;
	}
}
